namespace mplat {
    export class OppoOpenAbility extends OpenAbility {

        navigateToMiniProgram(param: INavigateParam) {
            if (!qg['navigateToMiniGame']) return;
            qg['navigateToMiniGame']({
                pkgName: param.appId,
                success: function () {
                    console.log('跳转成功', param.appId);
                },
                fail: function (res) {
                    console.log(JSON.stringify(res));
                }
            })
        }


        /** 是否添加过桌面图标，ov有的特性 */
        hasShortcutInstalled(success?: (res: any) => void, fail?: (err: any) => void, complete?: () => void) {
            if (!qg['hasShortcutInstalled']) {
                super.hasShortcutInstalled(success, fail, complete);
                return;
            }
            window['qg']['hasShortcutInstalled']({
                success: success,
                fail: fail,
                complete: complete
            });
        }
        installShortcut(message?: string, success?: () => void, fail?: (err: any) => void, complete?: () => void) {
            if (!qg['installShortcut']) {
                super.installShortcut(message, success, fail, complete);
                return;
            }
            window['qg']['installShortcut']({
                success: success,
                fail: fail,
                complete: complete
            });
        }

    }
}